<?php

class LogException extends Exception {
    
    public static function REGISTREER($ex) {
        $bestandPad = explode(DIRECTORY_SEPARATOR,$ex->getFile());
        $bestand = [];
        $nu = false;
        foreach ($bestandPad as $item) {
            if ($item == 'cms')
                $nu = true;
            if ($nu)
                array_push ($bestand, $item);
        }
        $bestand = implode('/',$bestand);
        
        $info = implode('<br>',['--bestand--',$bestand,
                                '--lijn--',$ex->getLine(),
                                '--boodschap--',$ex->getMessage()]);
        
        new LogEX(Systeem::LOG_EXCEPTION,$info);
    }
}
